package day5;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Triangle2 {
    public static void main(String[] args) {
        //空心  等腰  三角形
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入三角形的高度：");
        int h = sc.nextInt();
        for (int i = 1; i <= h; i++) {
            for (int k = h; k >= i; k--) {
                System.out.print("  ");
            }
            for (int j = 1; j <= i * 2 - 1; j++) {
                //！！！！！！！！！！
                if (i == 1 || i == h || j == 1 || j == 2 * i - 1)
                    System.out.print("* ");
                else
                    System.out.print("  ");
            }
            System.out.println();
        }
    }
}
